// Scripts/UI/GameCanvas.cs

using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class GameCanvas : MonoBehaviour
{
    [Header("UI组件")]
    public TextMeshProUGUI scoreText;
    public TextMeshProUGUI movesText;
    public TextMeshProUGUI levelText;
    public Button pauseButton;
    public GameObject gameOverPanel;
    
    void Start()
    {
        SetupUI();
    }
    
    void SetupUI()
    {
        // 设置Canvas Scaler
        // CanvasScaler scaler = GetComponent<CanvasScaler>();
        // scaler.uiScaleMode = CanvasScaler.ScaleMode.ScaleWithScreenSize;
        // scaler.referenceResolution = new Vector2(1080, 1920);
        // scaler.matchWidthOrHeight = 1.0f;
    }
    
    public void UpdateScore(int score)
    {
        scoreText.text = $"分数: {score}";
    }
    
    public void UpdateMoves(int moves)
    {
        movesText.text = $"步数: {moves}";
    }
}